// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueI18n from 'vue-i18n'
import $ from 'jquery'

import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
/*引入资源请求插件*/
import VueResource from 'vue-resource'
import axios from 'axios'

// 全局引入Toast
import './assets/css/toast.css';
import Toast from './assets/js/toast';
Vue.use(Toast);

/*使用VueResource插件*/
Vue.use(VueResource)

Vue.prototype.$http = axios

//Vue.use(Viewer) 默认配置写法
Vue.use(Viewer, {
    defaultOptions: {
        zIndex: 9999
    }
})

Vue.config.productionTip = false
Vue.use(VueI18n)

const i18n = new VueI18n({
  locale: localStorage.getItem('lang')||'en',
  messages: {
    'en': require('./lang/en'),
    'zh-CN': require('./lang/zh-CN'),
    'zh-TW': require('./lang/zh-TW')
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  components: { App },
  template: '<App/>',
  data:function(){
     return{
         homeIndex:0
     }
  }
})
